package com.bytech.comment.biz.service.comment;

import java.util.List;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bytech.common.biz.entity.base.BaseResult;
import com.bytech.common.biz.entity.blogUser.BlogUser;
import com.bytech.common.biz.entity.blogUser.BlogUserAgent;
import com.bytech.common.biz.entity.comment.Comment;
import com.baomidou.mybatisplus.extension.service.IService;
import com.bytech.common.biz.entity.comment.CommentDto;
import com.bytech.common.biz.entity.comment.CommentQuery;

/**
 * @Author Zhao
 * @Create 2021-08-04
 */
public interface CommentService extends IService<Comment> {

    int countByType(String type);

    int countByArticle(String articleId);

    BaseResult<Integer> deleteByArticleId(String articleId);

    List<CommentDto> getLatestComments(String commentType, Integer limit, String userId);

    BaseResult<BlogUserAgent> doComment(CommentDto commentDto, BlogUserAgent userAgent, HttpServletRequest request);

    Page<CommentDto> pageCommentByQuery(CommentQuery<Comment> commentQuery);

    void populateEmoticon(List<CommentDto> commentDtoList);

    BaseResult<List<CommentDto>> pageCommentReply(Long commentId, Integer pageNum, BlogUserAgent userAgent);
}
